﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Concurrent;

namespace Skyhook.AI.PathFinder
{
    class PathRequestStorage
    {
        ConcurrentQueue<PathRequest> Requests = new ConcurrentQueue<PathRequest>();

        public PathRequestStorage()
        {
        }

        public void AddRequest(PathRequest request)
        {
            Requests.Enqueue(request);
        }

        public PathRequest TakeRequest()
        {
            PathRequest result = null;
            Requests.TryDequeue(out result);
            return result;
        }

        public bool IsEmpty
        {
            get
            {
                return (Requests.Count == 0);
            }
        }
    }
}
